// 菜单管理
import {
    ajaxPost
} from '@/utils/data/request'

import { pick } from 'lodash'
// 菜单管理配置
export function all() {
    return ajaxPost("auth/manage-menu-list", null)
}

// 园区菜单权限
export function tree() {
    return ajaxPost("auth/menu-list", null, {
        cookies: ['yard_sn']
    })
}

// 编辑
export function edit(params: any) {
    return ajaxPost("auth/menu-edit", pick(params, ["menu_psn", "menu_name", "menu_path", "menu_backend_path", "menu_type", "menu_sn", "menu_scope", "status", "sort"]), { successMessage: true })
}

// 新增
export function add(params: any) {
    return ajaxPost("auth/menu-create", pick(params, ["menu_psn", "menu_name", "menu_path", "menu_backend_path", "menu_type", "menu_scope", "status", "sort"]), { successMessage: true })
}

// 删除
export function del({ menu_sn }: any) {
    return ajaxPost("auth/menu-delete", { menu_sn }, { successMessage: true })
}
